package com.study.authority.controller;


import com.study.authority.entity.User;
import com.study.authority.service.UserService;
import com.study.authority.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lemon
 * @since 2022-09-27
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("getAllUser")
    public Result getAllUser(){
        List<User> list = userService.list();
        return Result.ok(list);
    }

}

